/*
 * Copyright (c) 2018. czmc All Rights Reserved.
 * Author: czmc
 * Email: zxc6355533@163.com
 * Encoding: UTF-8
 */

package top.stime21.framework.mvp

import android.os.Bundle

/**
 * Author: czmc  Email: zxc6355533@163.com
 * Version:	1.0  Date:2018/3/1
 */
abstract class MvpActivity<P:MvpContract.Presenter> : BaseActivity() {


      var mPrensenter: P? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mPrensenter =   getPresenter()
    }

    override fun onDestroy() {
        super.onDestroy()
        if(mPrensenter!=null){
            mPrensenter!!.onViewDestory()
        }
    }
    protected abstract fun getPresenter(): P
}